package com.liuhx.controller;

import com.liuhx.entity.BrandEntity;
import com.liuhx.service.BrandService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by liuhx on 2017/6/21.
 */
@RestController
@RequestMapping("brand")
public class BrandController {
    @Resource
    BrandService brandService;
    @RequestMapping("find")
    public List<BrandEntity> find()
    {
        return  brandService.findBrand();

    }

    @RequestMapping("insert")
    public Map insert(@RequestBody List<BrandEntity> brandEntityList){
        brandService.insertBrands(brandEntityList);
        Map map = new HashMap();
        map.put("code",200);
        return map;
    }
}
